/*
 * @Author: 噜噜雯雯 2199987619@qq.com
 * @Date: 2025-05-28 11:29:08
 * @LastEditors: 噜噜雯雯 2199987619@qq.com
 * @LastEditTime: 2025-07-11 16:46:09
 * @FilePath: \linePatrol\vue-element-plus-admin\src\api\linePatrol\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import service from '@/axios/http'
// import { GetPlanGroupType, RoleType,ParameterListType,XunLineAreaType, EventTypeListType, AddEventType, EditEventType } from './type';
import { TableIResponse } from '@/utils/Api'
import { PostListType } from './type'

export class PostApi {
  //获取岗位
  async GetPostList(params: any): Promise<TableIResponse<PostListType[]>> {
    const result = (await service.get(`/api/system/post/list`, { params })) as unknown as any
    return result
  }
  //删除岗位
  async DeletPost(postId: string): Promise<boolean> {
    const result = (await service.delete(`/api/system/post/${postId}`)) as unknown as any
    const { code } = result as any
    if (code == 200) {
      return true
    } else {
      return false
    }
  }
  //新增岗位
  async AddPost(data: PostListType): Promise<boolean> {
    const result = (await service.post('/api/system/post', data)) as unknown as any
    const { code } = result as any
    if (code == 200) {
      return true
    } else {
      return false
    }
  }
  //修改岗位
  async EditPost(data: PostListType): Promise<boolean> {
    const result = (await service.put('/api/system/post', data)) as unknown as any
    const { code } = result as any
    if (code == 200) {
      return true
    } else {
      return false
    }
  }
}
export default new PostApi()
